﻿using Microsoft.Extensions.Configuration;

namespace FileStorage.Common.Extensions
{
    public static class ConfigurationExtensions
    {
        public static T GetSectionValue<T>(this IConfiguration configuration, string section = null) where T : Settings
        {
            var _ = configuration?.GetSection(section ?? typeof(T).Name);
            return _?.Get<T>();
        }
    }
}
